Skip to content

Conversation

Ishita-Jinturkar
Copy link

@Ishita-Jinturkar Ishita-Jinturkar commented Sep 12, 2025

This pull request introduces improved handling for WebSocket connections in the cdp_use/client.py module, specifically adding support for HTTP redirects and authentication errors during WebSocket connection establishment. The changes also lay groundwork for future WebSocket routing/interception features.

WebSocket connection improvements

  • Added a new _connect_with_redirects async function to handle HTTP redirects (301, 302, 307, 308) and authentication errors (401, 403) when establishing a WebSocket connection. This function follows redirects and raises descriptive errors as needed. (cdp_use/client.py)
  • Updated the start method to use _connect_with_redirects instead of the direct websockets.connect call, ensuring redirect and authentication handling is applied during connection setup. (cdp_use/client.py)

Issue link: browser-use/browser-use#3073

@Ishita-Jinturkar Ishita-Jinturkar changed the title Implement WebSocket routing and interception methods chore: Handle redirection status Sep 15, 2025
@Ishita-Jinturkar Ishita-Jinturkar marked this pull request as ready for review September 15, 2025 08:26
@Ishita-Jinturkar Ishita-Jinturkar changed the title chore: Handle redirection status feat: Handle redirection status Sep 15, 2025
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Ishita-Jinturkar
Copy link
Author

Ishita-Jinturkar commented Sep 16, 2025

Adding @gregpr07 @pirate @norbit8 for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant